# coding:utf-8
from sqlalchemy import inspect, Column, Integer, String, SmallInteger, Text, orm
from app.models.base import Base


class UserRole(Base):
    __tablename__ = 'user_role'
    id = Column(Integer, primary_key=True, autoincrement=True, comment='主键')
    user_id = Column(String(15), nullable=False, comment='用户ID')
    role_id = Column(String(15), nullable=False, comment='角色ID')

    @orm.reconstructor
    def __init__(self):
        self.fields = ['id', 'user_id', 'role_id']
